def calculate_largest_prime(n=600851475143)
	facarr=[]
	(2..Math.sqrt(n)).each do |a|
		if n%a==0
			facarr<<a
			puts a
			n=n/a
		else
			puts "Moving on...."
			a=a+1
		end
	end
	return facarr
end

a=calculate_largest_prime()
i=a.rindex(a.max)
puts a[i]
